package com.coldchain.common.feign;

import com.coldchain.common.auth.AuthUser;
import com.coldchain.common.msg.BaseResponse;
import com.coldchain.common.msg.ObjectRestResponse;
import org.springframework.cloud.netflix.feign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.Map;


@FeignClient(value="ch-cys")
public interface CarDriverFeign {
	

	
	@RequestMapping(value="/cys/carDriver/validateCarDriver",method={RequestMethod.POST})
	public ObjectRestResponse<AuthUser> validateCarDriver(@RequestParam("username") String username
			, @RequestParam("password") String password) ;
	
	@RequestMapping(value="/cys/carDriver/getCarDriverInfo/{id}",method={RequestMethod.GET})
	public ObjectRestResponse<Map<String,Object>> getCarDriverInfo(@PathVariable("id") Long id) ;


	/**
	 * 更新订单数量
	 * @param driverid
	 * @return
	 */
	@RequestMapping(value="/cys/carDriver/doIncrementSuccessOrder",method= {RequestMethod.POST})
	public BaseResponse doIncrementSuccessOrder(@RequestParam("driverid") Long driverid) ;

	/**
	 * 更新退单数量
	 * @param driverid
	 * @return
	 */
	@RequestMapping(value="/cys/carDriver/doIncrementRetreatOrder",method= {RequestMethod.POST})
	public BaseResponse doIncrementRetreatOrder(@RequestParam("driverid") Long driverid) ;

	/**
	 * 司机短信验证码登录
	 * @param phone
	 * @param code
	 * @return
	 */
	@RequestMapping(value="/cys/carDriver/validateCarDriverCode")
	public ObjectRestResponse<AuthUser> validateCarDriverCode(@RequestParam("phone") String phone,@RequestParam("code") String code) ;
}
